tick

 

A tick is a measure of time in NetLogo models (like seconds or minutes). Ticks are used instead of these real world measures of time, because ticks are standardized across all models and computers; some models and computers run slower than others, but ticks are always the same!

When creating a model, you have the option of choosing continuous or tick-based updates. This changes how often the view updates; continuous displays every change as it happens, and tick-based updates the entire model after one tick. Most models in the Models Library use tick-based updates. If your model is using tick-based updates, it must include tick, usually placed at the end of the go procedure. The primitive tick advances the tick counter by one, and updates the plots and monitors of a model. If you are using tick-based updates and include tick in your code, you must remember to reset the ticks before running the model by adding reset-ticks into the setup procedure, or else an error will occur. See reset-ticks for more.

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the tick primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Published NetLogo models that use the tick primitive:
 
 
Similar primitives:
reset-ticks

Sets the tick counter to 0.

Read more
to

used to begin a command procedure

Read more
repeat

allows you to execute any set of commands n amount of times

Read more
clear-all

clears all the drawings, turtles, plots, etc., leaving a blank slate.

Read more
 
Learn another primitive